import type { PageResult } from '@/types/global'
import type {
  BannerItem,
  CategoryItem,
  GuessItem,
  HotItem,
  ParamsData,
} from '@/types/home'
import { http } from '@/utils/http'

export const getHomeBannerAPI = (distributionSite = 1) =>
  http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: { distributionSite },
  })

//首页-前台分类-小程序  /home/category/mutli
export const getHomeCategoryAPI = () =>
  http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })

//首页-热门推荐-小程序 GET/home/hot/mutli
export const getHomeHotAPI = () =>
  http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
//猜你喜欢  /home/goods/guessLike
export const getHomeGoodsAPI = (params?: ParamsData) =>
  http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data: params,
  })
